home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / util / moni / Scout-src.lha / netinclude / rpcsvc / bootparam_prot.x next >
Text File  |  2002-09-16  |  2KB  |  70 lines

  1. /* @(#)bootparam_prot.x    2.1 88/08/01 4.0 RPCSRC */
  2. /* @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro */
  3.  
  4.  
  5. /*
  6.  * RPC for bootparms service.
  7.  * There are two procedures:
  8.  *   WHOAMI takes a net address and returns a client name and also a
  9.  *    likely net address for routing
  10.  *   GETFILE takes a client name and file identifier and returns the
  11.  *    server name, server net address and pathname for the file.
  12.  *   file identifiers typically include root, swap, pub and dump
  13.  */
  14.  
  15. #ifdef RPC_HDR
  16. %#include <rpc/types.h>
  17. %#include <sys/time.h>
  18. %#include <sys/errno.h>
  19. %#include <nfs/nfs.h>
  20. #endif
  21.  
  22. const MAX_MACHINE_NAME  = 255;
  23. const MAX_PATH_LEN    = 1024;
  24. const MAX_FILEID    = 32;
  25. const IP_ADDR_TYPE    = 1;
  26.  
  27. typedef    string    bp_machine_name_t<MAX_MACHINE_NAME>;
  28. typedef    string    bp_path_t<MAX_PATH_LEN>;
  29. typedef    string    bp_fileid_t<MAX_FILEID>;
  30.  
  31. struct    ip_addr_t {
  32.     char    net;
  33.     char    host;
  34.     char    lh;
  35.     char    impno;
  36. };
  37.  
  38. union bp_address switch (int address_type) {
  39.     case IP_ADDR_TYPE:
  40.         ip_addr_t    ip_addr;
  41. };
  42.  
  43. struct bp_whoami_arg {
  44.     bp_address        client_address;
  45. };
  46.  
  47. struct bp_whoami_res {
  48.     bp_machine_name_t    client_name;
  49.     bp_machine_name_t    domain_name;
  50.     bp_address        router_address;
  51. };
  52.  
  53. struct bp_getfile_arg {
  54.     bp_machine_name_t    client_name;
  55.     bp_fileid_t        file_id;
  56. };
  57.     
  58. struct bp_getfile_res {
  59.     bp_machine_name_t    server_name;
  60.     bp_address        server_address;
  61.     bp_path_t        server_path;
  62. };
  63.  
  64. program BOOTPARAMPROG {
  65.     version BOOTPARAMVERS {
  66.         bp_whoami_res    BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1;
  67.         bp_getfile_res    BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2;
  68.     } = 1;
  69. } = 100026;
  70.